﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Licenta1.Expressions;

namespace Licenta1.Statements
{
    class WhileStatement:Statement
    {
        BooleanExpression condition;
        Statement stat;

        public WhileStatement(Context context, Expression cond, Statement s)
            : base(context)
        {
            condition = (BooleanExpression)cond;
            stat = s;
        }

        public override void Execute()
        {
            while (condition.Value.ToString() == "True")
                stat.Execute();
        }
    }
}
